<div class="member sixteen columns">
    <div class="box_head">
        <h3>Informasi Retur Detail</h3>
    </div>
    <div class="status_kirim">
        <table>
            <tr>
                <td><p>Jenis Pengiriman : <b> <?php echo $list_data->nama_mitra ?>  </b> </p></td>
                <td><p>Tanggal Pengiriman : <b> <?php echo $list_data->tgl_pengiriman_retur ?> </b> </p></td>
                <td><p>Nomer Pengiriman : <b> <?php echo $list_data->nomer_pengiriman_retur ?>  </b> </p></td>
            </tr>
        </table>

    </div>

    <div class="five columns alpha">
        <div class="box_head">
            <h3>Alamat Pemesanan</h3>
        </div>
        <p> <span> Nama Depan </span> : <b> <?php echo $list_data->nama_depan ?> </b> </p> 
        <p> <span> Nama Belakang </span> : <b><?php echo $list_data->nama_belakang ?> </b></p>
        <p> <span> Provinsi </span> : <b><?php echo $list_data->nama_provinsi1 ?> </b></p>
        <p> <span> Kota</span> : <b><?php echo $list_data->nama_kota1 ?> </b></p>
        <p> <span> Alamat</span> : <b><?php echo $list_data->alamat ?> </b></p>
        <p> <span> Kode Pos</span>: <b><?php echo $list_data->kode_pos ?> </b></p>
        <p> <span> Telp</span> : <b><?php echo $list_data->telp ?> </b></p>
    </div>

    <div class="six columns  ">
        <div class="box_head">
            <h3>Alamat Pengiriman</h3>
        </div>
        <p> <span> Nama Depan </span> : <b> <?php echo $list_data->nama_depan2 ?> </b> </p> 
        <p> <span> Nama Belakang </span> : <b><?php echo $list_data->nama_belakang2 ?> </b></p>
        <p> <span> Provinsi </span> : <b><?php echo $list_data->nama_provinsi2 ?> </b></p>
        <p> <span> Kota</span> : <b><?php echo $list_data->nama_kota2 ?> </b></p>
        <p> <span> Alamat</span> : <b><?php echo $list_data->alamat2 ?> </b></p>
        <p> <span> Kode Pos</span>: <b><?php echo $list_data->kode_pos2 ?> </b></p>
        <p> <span> Telp</span> : <b><?php echo $list_data->telp2 ?> </b></p>
    </div>

    <div class="five columns  omega">
        <div class="box_head">
            <h3>Informasi Pemesanan</h3>
        </div>
        <?php
        $id_transaksi = $list_data->id;
        $id_retur = $list_data->retur_id;
        ?> 
        <p> <span> Retur ID  </span> : <b><?php echo $list_data->retur_id ?> </b></p>
        <p> <span> Tanggal Retur </span> : <b><?php echo $list_data->tgl_retur ?> </b></p>
        <br/>
        <p> <span> Order ID </span> : <b><?php echo $list_data->id ?> </b></p>
        <p> <span> Tanggal Transaksi </span> : <b><?php echo $list_data->date ?> </b></p>
        <br/>
        <?php
        $status = "";

        if ($list_data->status_retur == 2)
            $status = "Sukses";
        else if ($list_data->status_retur == 1)
            $status = "Gagal";
        else {
            $tgl1 = date('Y-m-d'); // 1 Oktober 2010

            $pecah1 = explode("-", $tgl1);
            $date1 = $pecah1[2];
            $month1 = $pecah1[1];
            $year1 = $pecah1[0];

            $tgl2 = $list_data->tgl_retur; // 10 Oktober 2010
            $date2 = substr($tgl2, 8, 2);
            $month2 = substr($tgl2, 5, 2);
            $year2 = substr($tgl2, 0, 4);

            $jd1 = GregorianToJD($month1, $date1, $year1);
            $jd2 = GregorianToJD($month2, $date2, $year2);

            //pengurangan jadi nilai hari
            $selisih = $jd1 - $jd2;

            if ($selisih <= 7)
                $status = "Proses";
            else
                $status = "Gagal";
        }
        ?>
        <p> <span> Order Status</span> : <b><?php echo $status ?> </b></p>
    </div>


    <div class="clear"></div>
    <br/>
    <p>
        <b>Komentar seputar pemesanan anda :</b> <br/>

        <label>

            <textarea class="eight columns alpha" rows="4"  id="komentar" name="komentar" readonly><?php echo $list_data->komentar ?></textarea>

        </label>


    </p> 
    <div class="clear"></div>   
    <br/>
    <table class="cart_table">
        <tr>
            <th style="width: 330px;"> Nama Produk </th>
            <th style="width: 50px; "> Bny</th>
            <th style="width: 300px; vertical-align:middle ;"> Alasan Retur Barang </th>
        </tr> 
        <?php
        $lib_rupiah = new Format_rupiah();
        $lib_img = new images_thumb();
        foreach ($list_data_det as $dta_det) {
            $gambar = base_url() . "uploads/" . $dta_det->id_produk . "/" . $lib_img->image($dta_det->image1);
            echo "<tr class='biaya' >";
            echo "<td><img src='$gambar' width='100' align='left' style='margin-right:5px;'/> 
                            <p style='text-align:left; font-size:12px;'> Kode Produk : <b>$dta_det->id_produk</b> <br/> 
                            Ukuran Produk : <b>$dta_det->size_produk</b> <br/> 
                            Warna Produk : <b>$dta_det->warna</b> <br/> 
                            </p> <br/></td>";

            echo "<td style='vertical-align: middle; text-align:center;'> <p> <b> $dta_det->bny </b> </p> </td>";
            echo "<td style='vertical-align: middle; text-align:center;'> <textarea readonly  cols='50' rows='4'>$dta_det->alasan</textarea></td>";
            echo "</tr>";
        }
        ?>

    </table>
    <div class="clear"></div>  
    <br/>

    <?php
    echo anchor("main/member/view_history_retur", "   Kembali   ", "class='red_btn' style='color:white'");
    ?>



    <div class="clear"></div>  


</div>

